#/usr/bin/bash

#Run as - "ruby execute.rb"

module Com
module Googlecode
module VikrantIncubator
  
  def vi_execute
    all_files = Dir[File.dirname(__FILE__) + "/*.rb"] - 
      ["execute.rb", "require-all.rb", "helper.rb"].map { |f|
        File.dirname(__FILE__) + "/" + f
      }
    puts "Execute which?"
    all_files.each { |f|
      puts "#{all_files.index(f)+1}: #{File.basename(f)}"
    }
    selected = all_files[gets.to_i-1]
    require selected
    return selected.gsub(/\.rb$/, "").gsub(/^.*(\\|\/)/, "") #greedy by default.
  end

end
end
end

include Com::Googlecode::VikrantIncubator

send "#{vi_execute}"

